package sevensoft.行为型模式.迭代器模式;

import java.io.File;
import java.io.FileInputStream;

public class Demo {
    public static void main(String[] args) {
        MyAggregate<Integer> aggregate = new MyAggregateImpl<>();
        aggregate.add(3);
        aggregate.add(4);
        aggregate.add(9);
        aggregate.add(11);
        MyIterator<Integer> iterator = aggregate.getIterator();
        while (iterator.hasNext()) {
            System.out.println(iterator.next());
        }

    }
}
